<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function max () {
        var args = arguments; // 为了减少代码的拼写错误
        // 此时 args 就可以当做数组来使用
        var maxNum = args[ 0 ];
        for ( var i = 1; i < args.length; i++ ) {
            if ( maxNum < args[ i ] ) {
                maxNum = args[ i ];
            }
        }

        return maxNum;
    }

    console.log( max( 1, 3, 2, -9, 4 ) );
</script>
</html>